import { routerRedux } from 'dva/router';
import { showMenuByRole } from '../services/api';

export default {
  namespace: 'siderMenu',

  state: {
    status: undefined,
  },

  effects: {
    *fetchShowMenuByRole({ payload,callback }, { call, put }) {
      const response = yield call(showMenuByRole, payload);
      callback(response);
    },
  },

  reducers: {
    changeSubmitting(state, { payload }) {
      return {
        ...state,
        submitting: payload,
      };
    },
  },
};
